Once we have a bootstrapped sampling distribution, we can use it to make confidence intervals.
price
18300
20100
9600
10700
27000
Open the Bootstrapping Applet. Clear the preloaded data and paste in the above price data (including the header).
Check Show Sampling Options and make a bootstrap distribution of sample means from this sample.
Use the SD from the distribution to calculate a 95% SE confidence interval for the mean price.
Select Beyond from the count samples dropdown. Use trial and error to find the upper endpoint of a 95% percentile confidence interval.
Central Limit Theorem for the sample mean. When we collect a sufficiently large sample of \(n\) independent observations from a population with mean \(\mu\) and standard deviation \(\sigma\), the sampling distribution of \(\bar{x}\) will be nearly normal with mean \(\mu\) and standard deviation \(SE = \sigma/\sqrt{n}\).
As with pnorm and pchisq, you can get lower
tail probabilities in R using pt.
[1] 0.01087021
[1] 0.01087021
If you know the tail probability you want, you can get the corresponding t.
[1] -2.200985
[1] 2.200985
Recall that for the normal distribution, these values were \(\pm 1.96\) (fatter tails).
The generic formulas for confidence intervals work for t-intervals:
\[ \begin{aligned} \text{point estimate} \ &\pm\ t^{\star}_{df} \times SE \\ \bar{x} \ &\pm\ t^{\star}_{df} \times \frac{s}{\sqrt{n}} \end{aligned} \]
To get \(t^\star_{df}\) you can use
qt in R and you need the degrees of freedom (\(n-1\)).
\[ H_0: \mu = \text{null value} \\ H_A: \mu \neq \text{null value} \]
The generic \(Z\)-score formula gives us a formula for \(T\)-score:
\[ T = \frac{\bar{x} - \mbox{null value}}{s/\sqrt{n}} \]
A sample of 14 frogs has a mean weight of 26.45 grams with a sample standard deviation of 3.98.
Construct a 95% confidence interval for the mean weight of the
frogs in this population. (Use qt to determine \(t^\star_{df}\), and then use the t-interval
formula.)
Is the mean weight of the frogs in this population significantly
different from the Northern Leopard Frog, which has a mean weight of 24
grams? Obtain a P-value for the following hypothesis test: \[
H_0: \mu = 24 \\
H_A: \mu \neq 24
\] (Use the \(T\)-score formula,
and then use pt to get a P-value.)
The frogs vector contains the weights of the 14 frogs in
our sample.
One Sample t-test
data: frogs
t = 2.3008, df = 13, p-value = 0.0386
alternative hypothesis: true mean is not equal to 24
95 percent confidence interval:
24.14950 28.74841
sample estimates:
mean of x
26.44895